package com.kgc.dao;

import com.kgc.entity.Category;
import com.kgc.entity.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CategoryMapper {

    List<Category> getAllCategory();

    int addCategory(Category category);

    int updateCategory(Category category);

    int deleteCategory(int id);

    int getProductByCategoryId(int id);


    int getSonCountByCategoryId(int id);

    List<Category> getType1Category();

    List<Category> getType2Category(int id);

    List<Category> getType3Category(int id);

    Category getCategoryByName(@Param("name") String name, @Param("type") int type);

    Category getCategoryById(int id);

    List<Product> getProductsByCategoryId(int id);
}
